﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace JBot {
	/// <summary>
	/// Interaction logic for ContactsControl.xaml
	/// </summary>
	public partial class ContactsControl : UserControl {
		public ContactsControl( ) {
			this.InitializeComponent( );
		}

		private void CtC_TB_Add_Click(object sender, RoutedEventArgs e) {
			var addWindow = new Dialogs.AddContactWindow( );
			addWindow.Owner = App.Current.MainWindow;
			if (addWindow.ShowDialog( ) == true) {

			}
		}

		private void CtC_TB_Edit_Click(object sender, RoutedEventArgs e) {

		}

		private void CtC_TB_Delete_Click(object sender, RoutedEventArgs e) {

		}

		private void CtC_TB_Block_Click(object sender, RoutedEventArgs e) {

		}

		private void CtC_TB_Message_Click(object sender, RoutedEventArgs e) {

		}

		private void CtC_LV_SelectionChanged(object sender, SelectionChangedEventArgs e) {
			var newState = this.CtC_LV.SelectedItem != null;
			this.CtC_TB_Edit.IsEnabled = newState;
			this.CtC_TB_Delete.IsEnabled = newState;
			this.CtC_TB_Block.IsEnabled = newState;
			this.CtC_TB_Message.IsEnabled = newState;
		}
	}
}